import { http } from "@/tools/request";

// 获取用户信息
const userLogin = (params) => {
  return http.request({
    method: "post",
    url: "/api/user/login",
    data:params
  });
};


// 获取用户信息
const getUserInfo = () => {
  return http.request({
    method: "get",
    url: "/api/user/info",
  });
};

const getGroupList = () => {
  return http.request({
    method: "get",
    url: "/api/chat/groups",
  });
};

const addGroup = (params = {}) => {
  return http.request({
    method: "post",
    url: "/api/chat/addGroup",
    data: params,
  });
};

const editGroup = (params = {}) => {
  return http.request({
    method: "post",
    url: "/api/chat/editGroup",
    data: params,
  });
};

const deleteGroup = (params = {}) => {
  return http.request({
    method: "post",
    url: "/api/chat/deleteGroup",
    data: params,
  });
};

const getGroupChatMsg = (params = {}) => {
  return http.request({
    method: "get",
    url: "/api/chat/getGroupChatMsg",
    params: params,
  });
};
export {
  getGroupList,
  addGroup,
  editGroup,
  deleteGroup,
  getGroupChatMsg,
  getUserInfo,
  userLogin
};
